var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (cm.getInfoQuest(31057).contains("kill=clear")) {
                cm.updateInfoQuest(31057, "door=clear;kill=clear");
                cm.forceCompleteQuest(31059);
                cm.playerMessage(-1, "发现了通道.")
            } else {
                cm.playerMessage(-1, "还有敌人没有消灭干净.");
                cm.playerMessage(5, "还有敌人没有消灭干净.")
            }
            cm.dispose()
        }
    }
};